package com.caht.controller.user;

import com.caht.DTO.inertlikestateUserDTO;
import com.caht.entity.likestate;
import com.caht.result.Result;
import com.caht.servier.Impl.likestateServierImpl;
import com.caht.servier.PostsServier;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 点赞功能的视实现
 */
@RestController
@RequestMapping("/user/likestate")
@Slf4j
public class likestateController {
    @Autowired
    private likestateServierImpl likestateServier;

    /**
     * 点赞
     */
    @PostMapping()
    public void clickLike(@RequestBody inertlikestateUserDTO inertlikestateUserDTO){
        likestateServier.clickLike(inertlikestateUserDTO);
    }

    /**
     * 取消点赞
     * @param inertlikeDTO
     */
    @PostMapping("/cancellation")
    public void cancellation(@RequestBody inertlikestateUserDTO inertlikeDTO) {
        likestateServier.cancellation(inertlikeDTO);
    }
    /**
     * 查询点赞信息
     */
 /*   @GetMapping()
    public Result<List<likestate>> queryAll(){
        List<likestate> likestates = likestateServier.queryAll();
        return Result.success(likestates);
    }*/
}
